#!/usr/bin/env php
<?php

define('ROOT_PATH', __DIR__);
require_once ROOT_PATH  . '/vendor/autoload.php';

use support\command\Application;

$application = new Application();

$commandList = config('console.commands', []);

foreach ($commandList as $key => $name) {
    /** @var support\command\Command */
    $command = new $name();
    if (is_string($key)) {
        $command->setAliases([$key]);
    }

    $application->add($command);
}


$application->run();